package com.ruben.strategies.exapmle;

import java.util.List;

/**
 * 路线规划应用
 *
 * @author <achao1441470436@gmail.com>
 * @since 2021/10/16 19:36
 */
public class NavigatorApplication {
    public static void main(String[] args) {
        String start = "成华大道";
        String end = "二仙桥";
        System.out.println("用户选择了查看步路线");
        Navigator navigator = new Navigator(new WalkingStrategy());
        List<String> route = navigator.buildRoute(start, end);
        System.out.println(route);
        System.out.println("用户变更了策略，选择查看公路路线规划");
        navigator.setRouteStrategy(new RoadStrategy());
        route = navigator.buildRoute(start, end);
        System.out.println(route);
        System.out.println("用户变更了策略，选择查看公共交通路线规划");
        navigator.setRouteStrategy(new PublicTransportStrategy());
        route = navigator.buildRoute(start, end);
        System.out.println(route);
    }

}
